import $http from '../../../servers/http';
import { Result } from '../../schema/Result';
/* 系统配置-策略项管理
---------------------------------------------------------------- */
import { StrategyInfo } from '../../schema/Strategy';
/**新增策略项 */
export const createStrategy = (data: StrategyInfo): Promise<any> => {
  return $http.post({
    url: '/icms/strategyoptionmanage/strategyoptions',
    data,
  });
};

/**删除策略项 */
export const deleteStrategy = (id: number): Promise<Result<null>> => {
  return $http.delete({
    url: `/icms/strategyoptionmanage/strategyoptions/${id}`,
  });
};

/**编辑策略项 */
export const modifyStrategy = (id: number, data: StrategyInfo): Promise<Result<null>> => {
  return $http.put({
    url: `/icms/strategyoptionmanage/strategyoptions/${id}`,
    data,
  });
};

/**查询策略项列表 */
export const getStrategyList = (data: {
  pageSize: number;
  pageNo: number;
  strategyOptionName?: string;
}): Promise<Result<StrategyInfo[]>> => {
  return $http.get({
    url: '/icms/strategyoptionmanage/strategyoptions',
    data,
  });
};
